﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administration/main.master" AutoEventWireup="true" CodeBehind="WarrantyStaff_ViewEditDateStatus.aspx.cs" Inherits="CS424_9pts.Administration.WarrantyStaff_ViewEditDateStatus" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cph1" runat="server">
 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="WarrantyID"
        DataSourceID="SqlDataSource1">
        <Columns>
            <asp:TemplateField SortExpression="WarrantyID" HeaderText="WarrantyID">
                <EditItemTemplate>
                    <asp:Label runat="server" ID="Wid" Text='<%# Bind("WarrantyID")%>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" ID="XXX" Text='<%# Bind("WarrantyID") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="DateToCompany" HeaderText="DateToCompany" SortExpression="DateToCompany" ReadOnly="true" />
            <asp:BoundField DataField="DateBackToCompany" HeaderText="DateBackToCompany" SortExpression="DateBackToCompany" ReadOnly="true"/>
            <asp:BoundField DataField="DateToManufacturer" HeaderText="DateToManufacturer" SortExpression="DateToManufacturer" ReadOnly="true"/>
            <asp:BoundField DataField="DateBackToCustomer" HeaderText="DateBackToCustomer" SortExpression="DateBackToCustomer" ReadOnly="true"/>
            <asp:TemplateField SortExpression="Status" HeaderText="Status">
                <EditItemTemplate>
                    <asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="OnSelectedIndexChanged">
                        <asp:ListItem>  ------------------   </asp:ListItem>
                        <asp:ListItem>  Mới nhận xe của KH   </asp:ListItem>
                        <asp:ListItem>  Giao xe cho TTBH   </asp:ListItem>
                        <asp:ListItem>  Xe về công ty   </asp:ListItem>
                        <asp:ListItem>  Done!!!   </asp:ListItem>
                    </asp:DropDownList>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("Status") %>' ID="Label1"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ShowEditButton="True"  />

            <asp:TemplateField HeaderText="Note">
                <ItemTemplate>
                    <asp:HyperLink runat="server" NavigateUrl='<%#"Warranty_AddWarrantyNote.aspx?id=" + Eval("WarrantyID")%>' ID="hpLink">Click here to Read</asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
   
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CarManagementConnectionString %>"
        SelectCommand="SELECT Warranty.WarrantyID, Warranty.DateToCompany, Warranty.DateToManufacturer, Warranty.DateBackToCompany, Warranty.Status, Warranty.DateBackToCustomer, aspnet_Membership.Email, aspnet_Users.UserName FROM aspnet_Users INNER JOIN aspnet_Membership ON aspnet_Users.UserId = aspnet_Membership.UserId INNER JOIN Contract ON aspnet_Users.UserId = Contract.StaffID AND aspnet_Users.UserId = Contract.CustomerID INNER JOIN Warranty ON Contract.ContractID = Warranty.ContractID"
        >
    </asp:SqlDataSource>
    
</asp:Content>
